package com.zhujiahui.MavenZhuNLP;

import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;
import org.ujmp.core.Matrix;
import org.ujmp.core.calculation.Calculation.Ret;

/**
 * Hello world!
 *
 */
public class App 
{
	public static void testND4J1() {
		INDArray array1 = Nd4j.rand(3000, 3000);
		INDArray array2 = Nd4j.rand(3000, 3000);
		long startTime = System.currentTimeMillis();
		INDArray array3 = array1.mmul(array2);
		long endTime = System.currentTimeMillis();
		System.out.println("程序运行时间：" + (endTime - startTime) + "ms");
	}
	
	public static void testUJMP1() {
		Matrix mat1 = Matrix.Factory.rand(300, 300);
		Matrix mat2 = Matrix.Factory.rand(300, 300);
		long startTime = System.currentTimeMillis();
		Matrix mat3 = mat1.mtimes(Ret.ORIG, true, mat2);
		mat3.showGUI();
		long endTime = System.currentTimeMillis();
		System.out.println("程序运行时间：" + (endTime - startTime) + "ms");
	}
	
    public static void main( String[] args ) {
        testND4J1();
    	//testUJMP1();
    }
}
